#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

#define NOISY_TEST 1

void checkGainCard(struct gameState *pre) {
  struct gameState post;
  int test;
  memcpy (&post, pre, sizeof(struct gameState));
  printf("Player attempts to gain card not in supply\n");
  test = gainCard(ambassador, &post, 1, 0);
  assert(test == -1);
  printf("Player attempts to gain estate to deck\n");
  test = gainCard(estate, &post, 1, 0);
  assert(test == 0);
  printf("Player attempts to gain estate to hand\n");
  test = gainCard(estate, &post, 2, 0);
  assert(test == 0);
  printf("Player attempts to gain estate to discard\n");
  test = gainCard(estate, &post, 0, 0);
  assert(test == 0);
}

int main () {
  int k[10] = {adventurer, council_room, feast, gardens, mine,
	       remodel, smithy, village, baron, great_hall};
  struct gameState G;
  printf ("FIXED TESTING gainCard.\n");
  initializeGame(4, k, 1, &G);
  checkGainCard(&G);
  printf ("ALL TESTS OK\n");
  return 0;
}
